#ifndef CLIENT_H
#define CLIENT_H

#include <QtGlobal>
#include <QString>

#include <ace/SOCK_Stream.h>

enum ClientStatus {
    UNREADY,
    READY
};

class Client
{
public:
    Client();
    Client(ACE_HANDLE handle);
    Client(const ACE_SOCK_Stream &ass);
    ~Client() {}

    ACE_SOCK_Stream &getSOCK(){return _sock;}
    const ACE_SOCK_Stream &getSOCK() const {return _sock;}

    bool isReady() const {return _status == READY;}

    bool setReady(bool ready);
    bool empty() const {return _sock.get_handle() == 0;}

    void close() {_sock.close();}

    bool operator==(const Client &client) const;
    bool operator!=(const Client &client) const;
private:
    ACE_SOCK_Stream _sock;
    ClientStatus    _status;
};

#endif // CLIENT_H
